
  <div class="x_panel">
    <div class="x_content" style="display: block;">
      <!--表格主体内容-->
      <div class="nav navbar-right panel_toolbox">
        <a class="fa fa-plus" href="/user/add-contract.html">添加合同</a>
      </div>
      <br><br>
      <div class="cont">
        <table class="table table-bordered table-striped">
          <thead>
          <tr>
            <th width="100px">序号</th>
            <th>商家名称（点击编辑店主合同）</th>
            <th>店主账号</th>
            <th>店主合同开始时间</th>
            <th>店主合同结束时间</th>
            <th>店主合同创建时间</th>
            <th>店主合同状态</th>
            <th>店长（点击编辑店长合同）</th>
          </tr>
          </thead>
          <tbody>
          {foreach $contract.lists as $contractitem}
          <tr>
            <td>{$contractitem.shop_id}</a></td>
            <td><a href="{eval U(['user/edit-owner-contract','shop_id'=>$contractitem.shop_id])}">{$contractitem.shop_name}</a></td>
            <td>{$contractitem.owner_phone}</td>
            <td>{if $contractitem.contract_start_time}{date('Y-m-d',strtotime($contractitem.contract_start_time))}{/if}</td>
            <td>{if $contractitem.contract_end_time}{date('Y-m-d',strtotime($contractitem.contract_end_time))}{/if}</td>
            <td>{if $contractitem.contract_create_time}{$contractitem.contract_create_time}{/if}</td>
            <td>{if $contractitem.contract_start_time>date('Y-m-d H:i:s')}未开始{elseif $contractitem.contract_start_time<=date('Y-m-d H:i:s') && date('Y-m-d H:i:s')<=$contractitem.contract_end_time}进行中{elseif date('Y-m-d H:i:s')>$contractitem.contract_end_time && $contractitem.contract_end_time}已过期{else}暂无{/if}</td>
            <td>
              {foreach $contractitem.manager as $manageritem}
              <a href="{eval U(['user/edit-manager','user_id'=>$manageritem.user_id])}">{$manageritem.phone}</a>
              <button class="btn btn-danger btn-xs" data-toggle="dropdown">删除店长
                <i class="icon-angle-down"></i></button>
              <ul class="dropdown-menu">
                <li><a href="{eval U(['user/del-manager','user_id'=>$manageritem.user_id])}">确定</a></li>
                <li><a href="javascript:;">取消</a></li>
              </ul><br/>
              {/foreach}
            </td>
          </tr>
          {/foreach}
          </tbody>
        </table>
        <!--分页-->

        {Yii::$app->view->render('/com/pager.php',['pager'=>$contract['pager']])}
      </div>
    </div>
  </div>

